from typing import Dict
from FluidClass.default_fluid import water


class FluidSettings:

    def __init__(self, fluid_parameters: Dict = water):
        self.name = fluid_parameters["name"]
        self.mass_flow = float(fluid_parameters["mass_flow"])
        self.density = float(fluid_parameters["density"])
        self.dynamic_viscosity = round(float(fluid_parameters["dynamic_viscosity"]) / 1000, 6)

    def get_kinematic_viscosity(self):
        return self.dynamic_viscosity / self.density

    def get_volume_flow(self):
        return self.mass_flow / self.density

    def __str__(self):
        return f"{self.name}, {self.mass_flow}, {self.density}, {self.dynamic_viscosity}"
